<?php
namespace app\forum\controller;


class Block extends Base
{
    public function index()
    {

        $list = db('forum_block_part')->select();
        $pids = array_column($list, 'id');

        $blist = db('forum_block')->where('pid', 'in', $pids)->select();
        $arr = [];
        foreach ($blist as $v) {
            $arr[$v['pid']][] = $v;
        }

        $this->assign('list', $list);
        $this->assign('blist', $arr);
        return view('index');
    }


    public function posts(){
        $bid = input('bid');
        return view('posts');
    }
}
